import 'package:flutter_blog_manage_study/generated/json/base/json_field.dart';
import 'package:flutter_blog_manage_study/generated/json/language_entity.g.dart';
import 'dart:convert';
export 'package:flutter_blog_manage_study/generated/json/language_entity.g.dart';

/// * 作者: Tao
/// * 日期: 2024/3/22
/// * 时间: 9:47
/// * 描述: 语言实体类
@JsonSerializable()
class LanguageEntity {
	late String name = '';
	late String language = '';
	late String country = '';
	late bool isSelect = false;

	LanguageEntity();

	factory LanguageEntity.fromJson(Map<String, dynamic> json) => $LanguageEntityFromJson(json);

	Map<String, dynamic> toJson() => $LanguageEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

/// 多语言类型
final languageList = [
	LanguageEntity().copyWith(name: '简体中文', language: 'zh', country: 'CN'),
	LanguageEntity().copyWith(name: '繁體中文(香港)', language: 'zh', country: 'HK'),
	LanguageEntity().copyWith(name: 'English', language: 'zh', country: 'US'),
];